package com.cdream.common.idempotent.autoconfig;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.concurrent.TimeUnit;

/**
 * @author : wh
 * @date : 2021/12/30 21:20
 * @description:
 */
@Getter
@Setter
@ConfigurationProperties(prefix = "idempotent")
public class IdempotentProperties {


    public static final String PREFIX = "idempotent";

    /**
     * 去重key redis名字
     */
    private String uniqueKeyPrefix = "mq:unique:";

    /**
     * 去重记录后缀
     */
    private String recordKeySuffix = "Record";

    /**
     * redis值
     */
    private String uniqueValue = "s";

    /**
     * 并发获取锁等待时间
     */
    private Long tryLockTime = 3000L;

    /**
     * 消费key存放时间默认3天
     */
    private Long keyTimeOut = 3L;

    /**
     * 消费key存放redis时间单位
     */
    private TimeUnit timeOutTimeUnit = TimeUnit.DAYS;



}
